#pragma once

#pragma unmanaged

#include <BWSAL\BuildOrderManager.h>

#pragma managed

#include "..\AiBase.h"
#include "Interfaces\IBuildOrderManager.h"
#include "Interfaces\ITaskScheduler.h"
#include "Interfaces\ITaskExecutor.h"
#include "Interfaces\IBuildUnitManager.h"

using namespace BroodWar::Api;
using namespace BroodWar::Api::Enum;

namespace BroodWar
{
	namespace Addon
	{
		public ref class BuildOrderManager : public AiBase, IBuildOrderManager
		{
		internal:
			BWSAL::BuildOrderManager* instance;

			BuildOrderManager(BWSAL::BuildOrderManager* manager);
			~BuildOrderManager();
			!BuildOrderManager();

			static BuildOrderManager^ s_instance;
		public:
			static void Create(ITaskScheduler^ taskScheduler, ITaskExecutor^ taskExecutor, IBuildUnitManager^ buildUnitManager);
			static property BuildOrderManager^ Instance { BuildOrderManager^ get(); }

			virtual void OnFrame() override;
			virtual void Draw(int x, int y);
			virtual MacroTask^ Build(int count, Api::Enum::UnitType t, int priority, TilePosition^ seedLocation);
			virtual MacroTask^ Build(int count, Api::Enum::UnitType t, int priority);
			virtual MacroTask^ BuildAdditional(int count, Api::Enum::UnitType t, int priority, TilePosition^ seedLocation);
			virtual MacroTask^ BuildAdditional(int count, Api::Enum::UnitType t, int priority);
			virtual MacroTask^ BuildAdditional(int count, BuildType t, int priority, TilePosition^ seedLocation);
			virtual MacroTask^ BuildAdditional(int count, BuildType t, int priority);
			virtual MacroTask^ Research(TechType t, int priority);
			virtual MacroTask^ Upgrade(int level, UpgradeType t, int priority);
			virtual void DeleteMacroTask(MacroTask^ mt);
		};
	}
}
